package com.bonc.rms.dao.impl.tms;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.bonc.rms.dao.tms.ISalaryDao;
import com.bonc.rms.utils.JDBCUtil;

@Repository
public class SalaryDaoImpl implements ISalaryDao{

	private String [] columnName = new String[] {
			"id", 
			"job_number", 
			"basic_wage", 
			"performance", 
			"bonus", 
			"t_level", 
			"trial_basic_wage", 
			"trial_performance", 
			"trial_bonus", 
			"trial_t_level", 
			"social_security_welfare_cost", 
			"human_resource_cost", 
			"note"
		};
	
	@Override
	public List<Map<String, Object>> getSalaryByJobNumber(String jobNumber) {
		
		String sql =  "SELECT "
					+ "     t.* "
					+ "FROM "
					+ "     `salary` t "
					+ "WHERE "
					+ "     t.job_number = ? ";
		
		return JDBCUtil.queryList(
				sql, 
				columnName, 
				jobNumber
			);
	}

}
